﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using ArbabTravelsERP.Models;
using System.Data.SqlClient;

namespace ArbabTravelsERP.DAL
{
    public class CandidateDAL
    {
        DataUtility du = new DataUtility();

        public DataTable InsertCandidateDetails(CandidateModel cand,string filePath)
        {
            try
            {
                bool loginaccess = false;
                if (!string.IsNullOrEmpty(cand.LOGIN_ACCESS))
                {
                    loginaccess = true;
                }

                SqlParameter[] param = new SqlParameter[27];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);
                SqlParameter USER_TYPE_ID = new SqlParameter("@USER_TYPE_ID", "1");
                SqlParameter AVAILING_TYPE_ID = new SqlParameter("@AVAILING_TYPE_ID", cand.AVAILING_TYPE_ID);
                SqlParameter SOURCE_ID = new SqlParameter("@SOURCE_ID", cand.SOURCE_ID);
                SqlParameter STATUS_ID = new SqlParameter("@STATUS_ID", cand.STATUS_ID);
                SqlParameter VISIT_NUMBER = new SqlParameter("@VISIT_NUMBER", cand.VISIT_NUMBER);
                SqlParameter REQUIREMENT_ID = new SqlParameter("@REQUIREMENT_ID", cand.REQUIREMENT_ID);
                SqlParameter LOGIN_ACCESS = new SqlParameter("@LOGIN_ACCESS", loginaccess);
                SqlParameter LOGIN_PASSWORD = new SqlParameter("@LOGIN_PASSWORD", cand.LOGIN_PASSWORD);
                SqlParameter USER_IMAGE_PATH = new SqlParameter("@USER_IMAGE_PATH", filePath);
                SqlParameter REMARK = new SqlParameter("@REMARK", cand.REMARK);
                SqlParameter CREATED_BY = new SqlParameter("@CREATED_BY", "Ambi");
                SqlParameter IS_EXPERIENCED = new SqlParameter("@IS_EXPERIENCED", cand.IS_EXPERIENCED);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", "INSERT");
                SqlParameter WEBSITE = new SqlParameter("@WEBSITE", cand.WEBSITE);
                SqlParameter SKYPE = new SqlParameter("@SKYPE", cand.SKYPE);
                SqlParameter CONTACT_REMARK = new SqlParameter("@CONTACT_REMARK", cand.CONTACT_REMARK);
                SqlParameter EDUCATION_REMARK = new SqlParameter("@EDUCATION_REMARK", cand.EDUCATIONAL_REMARK);
                SqlParameter WORK_REMARK = new SqlParameter("@WORK_REMARK", cand.EXP_REMARK);
                SqlParameter BRANCH_CODE = new SqlParameter("@BRANCH_CODE", cand.BRANCH_CODE);

                SqlParameter NAME = new SqlParameter("@NAME", cand.NAME);
                SqlParameter CLIENT_DESIGNATION = new SqlParameter("@CLIENT_DESIGNATION", cand.CLIENT_DESIGNATION);
                SqlParameter CLIENT_INDUSTRY_ID = new SqlParameter("@CLIENT_INDUSTRY_ID", cand.CLIENT_INDUSTRY_ID);
                SqlParameter REFERENCE = new SqlParameter("@REFERENCE", cand.REFERENCE);
                SqlParameter CIVILIAN_NO = new SqlParameter("@CIVILIAN_NO", cand.CIVILIAN_NO);
                SqlParameter GAMCA_NO = new SqlParameter("@GAMCA_NO", cand.GAMCA_NO);
                SqlParameter LOCATION_CODE = new SqlParameter("@LOCATION_CODE", cand.LOCATION_CODE);

                param[0] = REGISTRATION_NO;
                param[1] = USER_TYPE_ID;
                param[2] = AVAILING_TYPE_ID;
                param[3] = SOURCE_ID;
                param[4] = STATUS_ID;
                param[5] = VISIT_NUMBER;
                param[6] = REQUIREMENT_ID;
                param[7] = LOGIN_ACCESS;
                param[8] = LOGIN_PASSWORD;
                param[9] = USER_IMAGE_PATH;
                param[10] = REMARK;
                param[11] = CREATED_BY;
                param[12] = IS_EXPERIENCED;
                param[13] = CONDITIONAL_OPERATOR;
                param[14] = WEBSITE;
                param[15] = SKYPE;
                param[16] = CONTACT_REMARK;
                param[17] = EDUCATION_REMARK;
                param[18] = WORK_REMARK;
                param[19] = BRANCH_CODE;

                param[20] = NAME;
                param[21] = CLIENT_DESIGNATION;
                param[22] = CLIENT_INDUSTRY_ID;
                param[23] = REFERENCE;
                param[24] = CIVILIAN_NO;
                param[25] = GAMCA_NO;
                param[26] = LOCATION_CODE;
                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable InsertCandidatePersonalDetails(CandidateModel cand)
        {
            try
            {
                if (cand.DATE_OF_BIRTH == null)
                {
                    cand.DATE_OF_BIRTH = null;
                }
                else
                {
                    cand.DATE_OF_BIRTH = DateTime.ParseExact(cand.DATE_OF_BIRTH, "dd/MM/yyyy", null).ToString();
                }

                SqlParameter[] param = new SqlParameter[14];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);
                SqlParameter FIRST_NAME = new SqlParameter("@FIRST_NAME", cand.FIRST_NAME);
                SqlParameter MIDDLE_NAME = new SqlParameter("@MIDDLE_NAME", cand.MIDDLE_NAME);
                SqlParameter LAST_NAME = new SqlParameter("@LAST_NAME", cand.LAST_NAME);
                SqlParameter FATHER_NAME = new SqlParameter("@FATHER_NAME", cand.FATHER_NAME);
                SqlParameter MOTHER_NAME = new SqlParameter("@MOTHER_NAME", cand.MOTHER_NAME);
                SqlParameter GENDER_CODE = new SqlParameter("@GENDER_CODE", cand.GENDER_CODE);
                SqlParameter DATE_OF_BIRTH = new SqlParameter("@DATE_OF_BIRTH", cand.DATE_OF_BIRTH);
                SqlParameter PLACE_OF_BIRTH = new SqlParameter("@PLACE_OF_BIRTH", cand.PLACE_OF_BIRTH);
                SqlParameter MARITAL_STATUS_ID = new SqlParameter("@MARITAL_STATUS_ID", cand.MARITAL_STATUS_ID);
                SqlParameter NATIONALITY_ID = new SqlParameter("@NATIONALITY_ID", cand.NATIONALITY_ID);
                SqlParameter CURRENT_LOCATION = new SqlParameter("@CURRENT_LOCATION", cand.CURRENT_LOCATION);
                SqlParameter RELIGION_ID = new SqlParameter("@RELIGION_ID", cand.RELIGION_ID);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", "INSERT");

                param[0] = REGISTRATION_NO;
                param[1] = FIRST_NAME;
                param[2] = MIDDLE_NAME;
                param[3] = LAST_NAME;
                param[4] = FATHER_NAME;
                param[5] = MOTHER_NAME;
                param[6] = GENDER_CODE;
                param[7] = DATE_OF_BIRTH;
                param[8] = PLACE_OF_BIRTH;
                param[9] = MARITAL_STATUS_ID;
                param[10] = NATIONALITY_ID;
                param[11] = CURRENT_LOCATION;
                param[12] = RELIGION_ID;
                param[13] = CONDITIONAL_OPERATOR;

                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_PERSONAL_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable SaveEmailDetails(CandidateModel cand, string Condition)
        {
            try
            {
                SqlParameter[] param = new SqlParameter[3];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", Condition);
                SqlParameter EMAIL_ID = new SqlParameter("@EMAIL_ID", cand.EMAIL_ID);

                param[0] = REGISTRATION_NO;
                param[1] = CONDITIONAL_OPERATOR;
                param[2] = EMAIL_ID;

                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_ADDRESS_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable SaveContactDetails(CandidateModel cand, string Condition)
        {
            try
            {
                SqlParameter[] param = new SqlParameter[4];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", Condition);
                SqlParameter PHONE_TYPE_ID = new SqlParameter("@CONTACT_TYPE_ID", cand.PHONE_TYPE_ID);
                SqlParameter PHONE_NO = new SqlParameter("@CONTACT_NO", cand.PHONE_NO);

                param[0] = REGISTRATION_NO;
                param[1] = CONDITIONAL_OPERATOR;
                param[2] = PHONE_TYPE_ID;
                param[3] = PHONE_NO;

                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_ADDRESS_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable SaveAddressDetails(CandidateModel cand, string Condition)
        {
            try
            {
                SqlParameter[] param = new SqlParameter[10];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);
                SqlParameter ADDRESS_TYPE_ID = new SqlParameter("@ADDRESS_TYPE_ID", cand.ADDRESS_TYPE_ID);
                SqlParameter ADDRESS = new SqlParameter("@ADDRESS", cand.ADDRESS);
                SqlParameter CITY_CODE = new SqlParameter("@CITY_CODE", cand.CITY_CODE);
                SqlParameter PIN_CODE = new SqlParameter("@PIN_CODE", cand.PIN_CODE);
                SqlParameter VILLAGE = new SqlParameter("@VILLAGE", cand.VILLAGE);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", Condition);
                SqlParameter PHONE_TYPE_ID = new SqlParameter("@CONTACT_TYPE_ID", cand.PHONE_TYPE_ID);
                SqlParameter PHONE_NO = new SqlParameter("@CONTACT_NO", cand.PHONE_NO);
                SqlParameter EMAIL_ID = new SqlParameter("@EMAIL_ID", cand.EMAIL_ID);

                param[0] = REGISTRATION_NO;
                param[1] = ADDRESS_TYPE_ID;
                param[2] = ADDRESS;
                param[3] = CITY_CODE;
                param[4] = PIN_CODE;
                param[5] = VILLAGE;
                param[6] = CONDITIONAL_OPERATOR;
                param[7] = PHONE_TYPE_ID;
                param[8] = PHONE_NO;
                param[9] = EMAIL_ID;

                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_ADDRESS_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable Save_Certification_Details(CandidateModel cand, string Condition)
        {
            try
            {
                SqlParameter[] param = new SqlParameter[6];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);
                SqlParameter CERTIFICATION = new SqlParameter("@CERTIFICATION", cand.CERTIFICATION);
                SqlParameter CERTIFICATION_LEVEL = new SqlParameter("@CERTIFICATION_LEVEL", cand.CERTIFICATION_LEVEL);
                SqlParameter INSTITUTE = new SqlParameter("@INSTITUTE", cand.INSTITUTE_NAME);
                SqlParameter YEAR_OF_PASSING = new SqlParameter("@YEAR_OF_PASSING", cand.INSTITUE_YEAR_OF_PASSIN);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", Condition);

                param[0] = REGISTRATION_NO;
                param[1] = CERTIFICATION;
                param[2] = CERTIFICATION_LEVEL;
                param[3] = INSTITUTE;
                param[4] = YEAR_OF_PASSING;
                param[5] = CONDITIONAL_OPERATOR;

                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_CERTIFICATION_LICENCE_VISA_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable Save_Visa_Details(CandidateModel cand, string Condition)
        {
            try
            {
                SqlParameter[] param = new SqlParameter[3];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", Condition);
                SqlParameter VISA_ID = new SqlParameter("@VISA_ID", cand.VISA_ID);

                param[0] = REGISTRATION_NO;
                param[1] = CONDITIONAL_OPERATOR;
                param[2] = VISA_ID;
                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_CERTIFICATION_LICENCE_VISA_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable Save_Licence_Details(CandidateModel cand, string Condition)
        {
            try
            {

                if (cand.DRIVING_DATE_OF_ISSUE == null)
                {
                    cand.DRIVING_DATE_OF_ISSUE = null;
                }
                else
                {
                    cand.DRIVING_DATE_OF_ISSUE = DateTime.ParseExact(cand.DRIVING_DATE_OF_ISSUE, "dd/MM/yyyy", null).ToString();
                }

                if (cand.DRIVING_EXPIRY_DATE == null)
                {
                    cand.DRIVING_EXPIRY_DATE = null;
                }
                else
                {
                    cand.DRIVING_EXPIRY_DATE = DateTime.ParseExact(cand.DRIVING_EXPIRY_DATE, "dd/MM/yyyy", null).ToString();
                }

                SqlParameter[] param = new SqlParameter[7];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", Condition);
                SqlParameter DRIVING_LICENCE_NUMBER = new SqlParameter("@DRIVING_LICENCE_NUMBER", cand.DRIVING_LICENCE_NUMBER);
                SqlParameter PLACE_OF_ISSUE = new SqlParameter("@PLACE_OF_ISSUE", cand.DRIVING_PLACE_OF_ISSUE);
                SqlParameter DATE_OF_ISSUE = new SqlParameter("@DATE_OF_ISSUE", cand.DRIVING_DATE_OF_ISSUE);
                SqlParameter EXPIRY_DATE = new SqlParameter("@EXPIRY_DATE", cand.DRIVING_EXPIRY_DATE);
                SqlParameter VEHICLE_TYPE_ID = new SqlParameter("@VEHICLE_TYPE_ID", cand.VEHICLE_TYPE_ID);

                param[0] = REGISTRATION_NO;
                param[1] = CONDITIONAL_OPERATOR;
                param[2] = DRIVING_LICENCE_NUMBER;
                param[3] = PLACE_OF_ISSUE;
                param[4] = DATE_OF_ISSUE;
                param[5] = EXPIRY_DATE;
                param[6] = VEHICLE_TYPE_ID;
                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_CERTIFICATION_LICENCE_VISA_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable Save_Passport_Details(CandidateModel cand, string Condition)
        {
            try
            {
                if (cand.DATE_OF_ISSUE == null)
                {
                    cand.DATE_OF_ISSUE = null;
                }
                else
                {
                    cand.DATE_OF_ISSUE = DateTime.ParseExact(cand.DATE_OF_ISSUE, "dd/MM/yyyy", null).ToString();
                }

                if (cand.EXPIRY_DATE == null)
                {
                    cand.EXPIRY_DATE = null;
                }
                else
                {
                    cand.EXPIRY_DATE = DateTime.ParseExact(cand.EXPIRY_DATE, "dd/MM/yyyy", null).ToString();
                }
                bool emigration = false;
                if (!string.IsNullOrEmpty(cand.IS_EMIGRATION))
                {
                    if (cand.IS_EMIGRATION == "Required")
                    {
                        emigration = true;
                    }
                }

                SqlParameter[] param = new SqlParameter[7];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);

                SqlParameter PASSPORT_PLACE_OF_ISSUE = new SqlParameter("@PASSPORT_PLACE_OF_ISSUE", cand.PLACE_OF_ISSUE);
                SqlParameter PASSPORT_DATE_OF_ISSUE = new SqlParameter("@PASSPORT_DATE_OF_ISSUE", cand.DATE_OF_ISSUE);
                SqlParameter PASSPORT_DATE_OF_EXPIRY = new SqlParameter("@PASSPORT_DATE_OF_EXPIRY", cand.EXPIRY_DATE);
                SqlParameter EMIGRATION_CLEARANCE_REQUIRED = new SqlParameter("@EMIGRATION_CLEARANCE_REQUIRED", emigration);
                SqlParameter PASSPORT_NO = new SqlParameter("@PASSPORT_NUMBER", cand.PASSPORT_NO);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", Condition);

                param[0] = REGISTRATION_NO;
                param[1] = PASSPORT_PLACE_OF_ISSUE;
                param[2] = PASSPORT_DATE_OF_ISSUE;
                param[3] = PASSPORT_DATE_OF_EXPIRY;
                param[4] = EMIGRATION_CLEARANCE_REQUIRED;
                param[5] = PASSPORT_NO;
                param[6] = CONDITIONAL_OPERATOR;
                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_CERTIFICATION_LICENCE_VISA_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable Save_Work_Details(CandidateModel cand, string Condition)
        {
            try
            {
                if (cand.WORK_PERIOD_FROM == null)
                {
                    cand.WORK_PERIOD_FROM = null;
                }
                else
                {
                    cand.WORK_PERIOD_FROM = DateTime.ParseExact(cand.WORK_PERIOD_FROM, "dd/MM/yyyy", null).ToString();
                }

                if (cand.WORK_PERIOD_TO == null)
                {
                    cand.WORK_PERIOD_TO = null;
                }
                else
                {
                    cand.WORK_PERIOD_TO = DateTime.ParseExact(cand.WORK_PERIOD_TO, "dd/MM/yyyy", null).ToString();
                }

                SqlParameter[] param = new SqlParameter[10];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", Condition);
                SqlParameter COMPANY_ID = new SqlParameter("@COMPANY_ID", cand.USER_COMPANY_NAME);
                SqlParameter IS_CURRENT_COMPANY = new SqlParameter("@IS_CURRENT_COMPANY", cand.IS_CURRENT_COMPANY);
                SqlParameter IS_EXPERIENCED = new SqlParameter("@IS_EXPERIENCED", cand.IS_EXPERIENCED);
                SqlParameter DESIGNATION_ID = new SqlParameter("@DESIGNATION_ID", cand.DESIGNATION_ID);
                SqlParameter INDUSTRY_ID = new SqlParameter("@INDUSTRY_ID", cand.INDUSTRY_ID);
                SqlParameter CITY_CODE = new SqlParameter("@CITY_CODE", cand.WORK_EXP_CITY_CODE);
                SqlParameter TOTAL_WORK_EXPERIENCE = new SqlParameter("@TOTAL_WORK_EXPERIENCE", cand.TOTAL_WORK_EXPERIENCE);
                SqlParameter CREATED_BY = new SqlParameter("@CREATED_BY", "ambi");

                param[0] = REGISTRATION_NO;
                param[1] = CONDITIONAL_OPERATOR;
                param[2] = COMPANY_ID;
                param[3] = IS_CURRENT_COMPANY;
                param[4] = IS_EXPERIENCED;
                param[5] = DESIGNATION_ID;
                param[6] = INDUSTRY_ID;
                param[7] = CITY_CODE;
                param[8] = TOTAL_WORK_EXPERIENCE;
                param[9] = CREATED_BY;
                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_EDUCATION_WORK_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable Save_Education_Details(CandidateModel cand, string Condition)
        {
            try
            {

                SqlParameter[] param = new SqlParameter[7];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);
                SqlParameter EDUCATION_TYPE_ID = new SqlParameter("@EDUCATION_TYPE_ID", cand.EDUCATION_TYPE_ID);
                SqlParameter SPECIALIZATION_TYPE_ID = new SqlParameter("@SPECIALIZATION_TYPE_ID", cand.SPECIALIZATION_TYPE_ID);
                SqlParameter UNIVERSITY_ID = new SqlParameter("@UNIVERSITY_ID", cand.UNIVERSITY_ID);
                SqlParameter UNIVERSITY_YEAR_OF_PASSING = new SqlParameter("@UNIVERSITY_YEAR_OF_PASSING", cand.UNIVERSITY_YEAR_OF_PASSING);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", Condition);
                SqlParameter CREATED_BY = new SqlParameter("@CREATED_BY", "ambi");

                param[0] = REGISTRATION_NO;
                param[1] = EDUCATION_TYPE_ID;
                param[2] = SPECIALIZATION_TYPE_ID;
                param[3] = UNIVERSITY_ID;
                param[4] = UNIVERSITY_YEAR_OF_PASSING;
                param[5] = CONDITIONAL_OPERATOR;
                param[6] = CREATED_BY;
                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_EDUCATION_WORK_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable Save_Document_Details(CandidateModel cand, string Condition)
        {
            try
            {

                SqlParameter[] param = new SqlParameter[4];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);
                SqlParameter DOCUMENT_PATH = new SqlParameter("@DOCUMENT_PATH", cand.DOCUMENT_PATH);
                SqlParameter DOCUMENT_TYPE_ID = new SqlParameter("@DOCUMENT_TYPE_ID", cand.DOCUMENT_TYPE_ID);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", Condition);

                param[0] = REGISTRATION_NO;
                param[1] = DOCUMENT_PATH;
                param[2] = DOCUMENT_TYPE_ID;
                param[3] = CONDITIONAL_OPERATOR;
                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_EDUCATION_WORK_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public DataTable Save_Language_Details(CandidateModel cand, string Condition)
        {
            try
            {

                SqlParameter[] param = new SqlParameter[6];
                SqlParameter REGISTRATION_NO = new SqlParameter("@REGISTRATION_NO", cand.REGISTRATION_NO);
                SqlParameter LANGUAGE_ID = new SqlParameter("@LANGUAGE_ID", cand.LANGUAGE_ID);
                SqlParameter IS_READ = new SqlParameter("@IS_READ", cand.IS_READ);
                SqlParameter IS_WRITE = new SqlParameter("@IS_WRITE", cand.IS_WRITE);
                SqlParameter IS_SPEAK = new SqlParameter("@IS_SPEAK", cand.IS_SPEAK);
                SqlParameter CONDITIONAL_OPERATOR = new SqlParameter("@CONDITIONAL_OPERATOR", Condition);

                param[0] = REGISTRATION_NO;
                param[1] = LANGUAGE_ID;
                param[2] = IS_READ;
                param[3] = IS_WRITE;
                param[4] = IS_SPEAK;
                param[5] = CONDITIONAL_OPERATOR;
                return du.ExecuteDataTable("StoredProcedure", "PROC_USER_EDUCATION_WORK_DETAILS", param);
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}